import static org.junit.Assert.*;

import org.junit.Test;


public class DeckTest {

	@Test
	public void testConstructor() {
		Deck d = new Deck();
		assertEquals(52, d.getCardsNumber());
		
		Card c;
		
		for(int i = 0; i < 52; i++)
		{
			c = d.takeCard();
			assertNotNull(c);
		}
	}

	@Test
	public void testIfHasAllCards() {
		boolean [][] usedCards = new boolean[4][13];
		
		for(int i = 0; i < 4; i++)
		{
			for(int j = 0; j < 13; j++)
			{
				usedCards[i][j] = false;
			}
		}
		
		Deck d = new Deck();
		
		
		Card c;
		for(int i = 0; i < 52; i++)
		{
			c = d.takeCard();
			usedCards[c.getColor()][c.getFigure()] = true;
		}
		
		for(int i = 0; i < 4; i++)
		{
			for(int j = 0; j < 13; j++)
			{
				assertEquals(true, usedCards[i][j]);
			}
		}
	}
}
